<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        /* 
            其它类型转换为Boolean类型
         */

         console.log(Boolean("abc")); //非空字符串转换后为true
         console.log(Boolean(""));   //空字符串转为后为false

         // 对于Number类型的话，只有0为false，其它的都是true
         console.log(Boolean(123));  
         console.log(Boolean(-123));
         console.log(Boolean(0));
         console.log(Boolean(-12.11));
         console.log(Boolean(12.11));

         //  特殊类型转换为Boolean都是false
         console.log(Boolean(null));
        console.log(Boolean(undefined));
        console.log(Boolean(NaN));
    </script>
</head>
<body>
    
</body>
</html>